import pygame

class MissileCommand():
	"""Test class - this should mostly be copypasta'd to the MainGameLoop"""
	_inTestMode = True
	_friendly = []
	_enemy = []
	_maxPlayerMissiles = 4
	_maxEnemyMissiles = 1
	_fClipEMissile = False	#if True -> friendly missiles will collide with enemy missiles
	_missileSpeed = 10	# hurm...definitely needs thought about - counts for both friendly/enemy (friendly = -enemy)
	
	# test stuff - ignore once pulled together
	xSize = 800
	ySize = 600
	shields = []
	enemies = []
	
	def __init__(self, maxPlayerMissiles = 4, maxEnemyMissiles = 2):
		
	
	def addMissile(isPlayer, xPos, yPos):
		if isPlayer:
			if len(_friendly) < maxPlayerMissiles:	#review logic
				_friendly.append(Missile(xPos, yPos))	#check x/y somewhere
		elif not isPlayer:
			if len(enemy) < maxEnemyMissiles:	#same goes
				enemy.append(Missile(xPos, yPos))
	
	def updateMissiles():
		# assume this is called at the necessary interval (X ms)
		for m in _friendly:
			m.move(_missileSpeed)
			# collision check
			# graphical display of effect? ignore until v2?
		for e in _enemy:
			e.move(-_missileSpeed)
			# collision check

class Missile:
	"""A single missile object. Logic is contained within (MissileCommand)"""
	_x = -1
	_y = -1
	
	def __init__(self, xPos, yPos):
		_x = xPos
		_y = yPos
		
	def move(yAmount):
		"""Missiles do not strafe"""
		_y += yAmount



if __name__=="__main__":
	print "IMMA CHARGIN MA LAZOR"
	game = MissileCommand(4,1)
	
